package com.gsnd.gsnd22estore.domain;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 订单表
 * @TableName es_order
 */
@Data
public class EsOrder implements Serializable {
    /**
     * 订单编号
     */
    private String id;

    /**
     * 下单用户
     */
    private Integer userId;

    /**
     * 创建订单时间
     */
    private Date createDate;

    /**
     * 支付方式
     */
    private String payWay;

    /**
     * 快递单号
     */
    private Integer trackingNumber;

    /**
     * 配送方式
     */
    private String distributionMode;

    /**
     * 订单状态
1.已创建未支付
2.已支付未发货
3.已发货未收货
4.已收货
5.已关闭 只能关闭 已创建未支付的订单
     */
    private Integer status;

    /**
     * 支付时间
     */
    private Date payDate;

    /**
     * 收货人姓名
     */
    private String receiveUsername;

    /**
     * 收货地址
     */
    private String receiveAddress;

    /**
     * 收货人电话
     */
    private String receivePhone;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EsOrder other = (EsOrder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getPayWay() == null ? other.getPayWay() == null : this.getPayWay().equals(other.getPayWay()))
            && (this.getTrackingNumber() == null ? other.getTrackingNumber() == null : this.getTrackingNumber().equals(other.getTrackingNumber()))
            && (this.getDistributionMode() == null ? other.getDistributionMode() == null : this.getDistributionMode().equals(other.getDistributionMode()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getPayDate() == null ? other.getPayDate() == null : this.getPayDate().equals(other.getPayDate()))
            && (this.getReceiveUsername() == null ? other.getReceiveUsername() == null : this.getReceiveUsername().equals(other.getReceiveUsername()))
            && (this.getReceiveAddress() == null ? other.getReceiveAddress() == null : this.getReceiveAddress().equals(other.getReceiveAddress()))
            && (this.getReceivePhone() == null ? other.getReceivePhone() == null : this.getReceivePhone().equals(other.getReceivePhone()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getPayWay() == null) ? 0 : getPayWay().hashCode());
        result = prime * result + ((getTrackingNumber() == null) ? 0 : getTrackingNumber().hashCode());
        result = prime * result + ((getDistributionMode() == null) ? 0 : getDistributionMode().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getPayDate() == null) ? 0 : getPayDate().hashCode());
        result = prime * result + ((getReceiveUsername() == null) ? 0 : getReceiveUsername().hashCode());
        result = prime * result + ((getReceiveAddress() == null) ? 0 : getReceiveAddress().hashCode());
        result = prime * result + ((getReceivePhone() == null) ? 0 : getReceivePhone().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", createDate=").append(createDate);
        sb.append(", payWay=").append(payWay);
        sb.append(", trackingNumber=").append(trackingNumber);
        sb.append(", distributionMode=").append(distributionMode);
        sb.append(", status=").append(status);
        sb.append(", payDate=").append(payDate);
        sb.append(", receiveUsername=").append(receiveUsername);
        sb.append(", receiveAddress=").append(receiveAddress);
        sb.append(", receivePhone=").append(receivePhone);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}